﻿/*
SINACOR - BMF&Bovespa
Arquivo: CodigoAssessorInformado.cs
Criado em: 08-jun-2010 17:14:32
Arquiteto Responsável: p-wgeneroso
*/
using System;
using System.Collections.Generic;
using System.Text;
using Sinacor.Infra.Common.Validation;
using Sinacor.Infra.Common.Exceptions;
using Sinacor.Infra.Service.ExceptionHandling;
using Sinacor.Infra.Service.Validation;
using Sinacor.Infra.Service.Validation.BusinessRules;


namespace Sinacor.Servico.Bovespa.ManutencaoOrdens.BusinessLogic.BusinessRulesValidation 
{
	public class CodigoAssessorInformado : BaseBusinessRuleValidation<BusinessEntity.Bloqueio>, IBusinessRuleValidation 
	{
		#region Atributos
        private int _erroAssessorNaoInformado = 109748;
		#endregion

		#region Propriedades
		public int ErroAssessorNaoInformado
		{
			get { return _erroAssessorNaoInformado; }
			set { _erroAssessorNaoInformado = value; }
		}
		#endregion

		#region Métodos
		public List<ValidationError> GetErrors()
		{
            return this.ErrorsList;
		}

		public void Validate()
		{
            //Valida Codigo Assessor Informado
            if (!this.EntityToValidate.CodigoAssessor.HasValue || this.EntityToValidate.CodigoAssessor.Value == 0)
                this.AddValidationError(ErroAssessorNaoInformado);
		}
		#endregion
	}

}